<!DOCTYPE html>
<html lang="zh" dir="ltr" class="client-nojs">
<head>
<title>基本概念</title>
<meta charset="UTF-8">
<meta name="generator" content="MediaWiki 1.21.2">
<link rel="shortcut icon" href="../../../common/favicon.ico">
<link rel="stylesheet" href="../../../common/ext.css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" href="../../../common/site_modules.css">
<style>a:lang(ar),a:lang(ckb),a:lang(fa),a:lang(kk-arab),a:lang(mzn),a:lang(ps),a:lang(ur){text-decoration:none}#toc{display:none}.editsection{display:none}
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-css:7:15cea3ec788a65b5187d4018eed543bf */</style>

<script src="../../../common/startup_scripts.js"></script>
<script>if(window.mw){
mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"c/language/basic_concepts","wgTitle":"c/language/basic concepts","wgCurRevisionId":57639,"wgArticleId":7929,"wgIsArticle":true,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"zh","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"zh","wgMonthNames":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgMonthNamesShort":["","1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],"wgRelevantPageName":"c/language/basic_concepts","wgUserVariant":"zh","wgRestrictionEdit":[],"wgRestrictionMove":[]});
}</script><script>if(window.mw){
mw.loader.implement("user.options",function(){mw.user.options.set({"ccmeonemails":0,"cols":80,"date":"default","diffonly":0,"disablemail":0,"disablesuggest":0,"editfont":"default","editondblclick":0,"editsection":0,"editsectiononrightclick":0,"enotifminoredits":0,"enotifrevealaddr":0,"enotifusertalkpages":1,"enotifwatchlistpages":0,"extendwatchlist":0,"externaldiff":0,"externaleditor":0,"fancysig":0,"forceeditsummary":0,"gender":"unknown","hideminor":0,"hidepatrolled":0,"imagesize":2,"justify":0,"math":1,"minordefault":0,"newpageshidepatrolled":0,"nocache":0,"noconvertlink":0,"norollbackdiff":0,"numberheadings":0,"previewonfirst":0,"previewontop":1,"quickbar":5,"rcdays":7,"rclimit":50,"rememberpassword":0,"rows":25,"searchlimit":20,"showhiddencats":0,"showjumplinks":1,"shownumberswatching":1,"showtoc":0,"showtoolbar":1,"skin":"cppreference2","stubthreshold":0,"thumbsize":2,"underline":2,"uselivepreview":0,"usenewrc":0,"watchcreations":0,"watchdefault":0,"watchdeletion":0,
"watchlistdays":3,"watchlisthideanons":0,"watchlisthidebots":0,"watchlisthideliu":0,"watchlisthideminor":0,"watchlisthideown":0,"watchlisthidepatrolled":0,"watchmoves":0,"wllimit":250,"variant":"zh","language":"zh","searchNs0":true,"searchNs1":false,"searchNs2":false,"searchNs3":false,"searchNs4":false,"searchNs5":false,"searchNs6":false,"searchNs7":false,"searchNs8":false,"searchNs9":false,"searchNs10":false,"searchNs11":false,"searchNs12":false,"searchNs13":false,"searchNs14":false,"searchNs15":false,"gadget-MathJax":1,"gadget-ColiruCompiler":1});;},{},{});mw.loader.implement("user.tokens",function(){mw.user.tokens.set({"editToken":"+\\","patrolToken":false,"watchToken":false});;},{},{});
/* cache key: mwiki1-mwiki_zh_:resourceloader:filter:minify-js:7:258d7cd6aa9aa67dee25e01fb6a9e505 */
}</script>
<script>if(window.mw){
mw.loader.load(["mediawiki.page.startup","mediawiki.legacy.wikibits","mediawiki.legacy.ajax"]);
}</script>
<!--[if lt IE 7]><style type="text/css">body{behavior:url("/mwiki/skins/cppreference2/csshover.min.htc")}</style><![endif]--></head>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-c_language_basic_concepts skin-cppreference2 action-view cpp-navbar">
        <!-- header -->
        <!-- /header -->
        <!-- content -->
<div id="cpp-content-base">
            <div id="content">
                <a id="top"></a>
                <div id="mw-js-message" style="display:none;"></div>
                                <!-- firstHeading -->
<h1 id="firstHeading" class="firstHeading">基本概念</h1>
                <!-- /firstHeading -->
                <!-- bodyContent -->
                <div id="bodyContent">
                                        <!-- tagline -->
                    <div id="siteSub">来自cppreference.com</div>
                    <!-- /tagline -->
                                        <!-- subtitle -->
                    <div id="contentSub"><span class="subpages">&lt; <a href="../../c.html" title="c">c</a>‎ | <a href="../language.html" title="c/language">language</a></span></div>
                    <!-- /subtitle -->
                                                            <!-- bodycontent -->
                    <div id="mw-content-text" lang="zh" dir="ltr" class="mw-content-ltr"><div class="t-navbar" style=""><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../../c.html" title="c"> C</a><div class="t-navbar-menu"><div><div><table class="t-nv-begin" cellpadding="0" style="line-height:1.1em;">
<tr class="t-nv"><td colspan="5"> <a href="../language.html" title="c/language">语言</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../header.html" title="c/header">头文件</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../types.html" title="c/types">类型支持</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../program.html" title="c/program">程序工具</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../variadic.html" title="c/variadic">变参数函数支持</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../memory.html" title="c/memory">动态内存管理</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../error.html" title="c/error">错误处理</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../chrono.html" title="c/chrono">日期和时间工具</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../string.html" title="c/string">字符串库</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../algorithm.html" title="c/algorithm">算法</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../numeric.html" title="c/numeric">数值</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../io.html" title="c/io">输入/输出支持</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../locale.html" title="c/locale">本地化支持</a> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../thread.html" title="c/thread">线程支持</a> <span class="t-mark-rev t-since-c11">(C11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../atomic.html" title="c/atomic">原子操作</a> <span class="t-mark-rev t-since-c11">(C11)</span> </td></tr>
<tr class="t-nv"><td colspan="5"> <a href="../experimental.html" title="c/experimental">技术规范</a> </td></tr>
</table></div><div></div></div></div></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><a href="../language.html" title="c/language">C 语言</a></div><div class="t-navbar-sep"> </div><div class="t-navbar-head"><strong class="selflink">基本概念</strong><div class="t-navbar-menu"><div><div style="display:inline-block">
<div><table class="t-nv-begin" cellpadding="0" style="">
<tr class="t-nv"><td colspan="5"> <a href="../comment.html" title="c/comment">注释</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="ascii.html" title="c/language/ascii">ASCII</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="escape.html" title="c/language/escape">转义序列</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="translation_phases.html" title="c/language/translation phases">翻译阶段</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="identifier.html" title="c/language/identifier">标识符</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="scope.html" title="c/language/scope">作用域</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="lifetime.html" title="c/language/lifetime">生存期</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="name_space.html" title="c/language/name space">查找与命名空间</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="type.html" title="c/language/types">类型</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="object.html" title="c/language/object">对象与对齐</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="arithmetic_types.html" title="c/language/arithmetic types">算术类型</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="main_function.html" title="c/language/main function"><code>main()</code> 函数</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="https://zh.cppreference.com/mwiki/index.php?title=c/language/as_if&amp;action=edit&amp;redlink=1" class="new" title="c/language/as if（页面不存在）">如同规则</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="behavior.html" title="c/language/behavior">未定义行为</a></td></tr>
<tr class="t-nv"><td colspan="5"> <a href="memory_model.html" title="c/language/memory model">内存模型与数据竞争</a></td></tr>
</table></div>
</div><div></div></div></div></div><div class="t-navbar-sep"> </div></div>
<p>本节提供描述 C 程序语言时指定用词的定义和所用概念。
</p><p>C 程序是包含<a href="declarations.html" title="c/language/declarations">声明</a>的一系列文本文件（通常是头文件和源文件）。它们会经过<a href="translation_phases.html" title="c/language/translation phases">翻译</a>变成可执行程序，在操作系统调用其<a href="main_function.html" title="c/language/main function">主函数</a>时被执行（除非它自己就是 OS 程序或其他<i>独立</i>程序，这种情况下入口点是编译器决定的）。
</p><p>某些词在 C 程序中拥有特别含义，它们是<a href="../keyword.html" title="c/keyword">关键词</a>。其他词可用做<a href="identifier.html" title="c/language/identifier">标识符</a>，可用于标识<a href="object.html" title="c/language/object">对象</a>、<a href="functions.html" title="c/language/functions">函数</a>、<a href="struct.html" title="c/language/struct">结构体</a>、<a href="union.html" title="c/language/union">联合体</a>、或<a href="enum.html" title="c/language/enum">枚举</a>标签、枚举成员、 <a href="typedef.html" title="c/language/typedef">typedef</a> 类型别名、<a href="statements.html#.E6.A0.87.E5.8F.B7" title="c/language/statements">标号</a>或<a href="../preprocessor/replace.html" title="c/preprocessor/replace">宏</a>。
</p><p>每个标识符（除了宏）仅在程序的一部分中合法，这部分被称为<a href="scope.html" title="c/language/scope">作用域</a>，而它们属于四种<a href="name_space.html" title="c/language/name space">命名空间</a>之一。一些标识符拥有<a href="storage_duration.html" title="c/language/storage duration">链接</a>，这会令它们出现于不同作用域或翻译单元时，指代同一实体。
</p><p>函数的定义包含一系列<a href="statements.html" title="c/language/statements">语句</a>和<a href="declarations.html" title="c/language/declarations">声明</a>，其中有的包含<a href="expressions.html" title="c/language/expressions">表达式</a>，它指定程序要进行的计算。
</p><p><a href="declarations.html" title="c/language/declarations">声明</a>和<a href="expressions.html" title="c/language/expressions">表达式</a>创建、销毁、访问并操作<a href="object.html" title="c/language/object">对象</a>。C中每个<a href="object.html" title="c/language/object">对象</a>、<a href="functions.html" title="c/language/functions">函数</a>及<a href="expressions.html" title="c/language/expressions">表达式</a>关联到一种<a href="type.html" title="c/language/types">类型</a>。
</p>
<h3><span class="mw-headline" id=".E5.8F.82.E9.98.85">参阅</span></h3>
<table class="t-dsc-begin">

</table>

<!-- 
NewPP limit report
Preprocessor visited node count: 950/1000000
Preprocessor generated node count: 3125/1000000
Post‐expand include size: 24604/2097152 bytes
Template argument size: 2786/2097152 bytes
Highest expansion depth: 13/40
Expensive parser function count: 0/100
-->

<!-- Saved in parser cache with key mwiki1-mwiki_zh_:pcache:idhash:7929-0!*!0!*!*!*!zh!* and timestamp 20200216161856 -->
</div>                    <!-- /bodycontent -->
                                        <!-- printfooter -->
                    <div class="printfooter">
                    来自“<a href="https://zh.cppreference.com/mwiki/index.php?title=c/language/basic_concepts&amp;oldid=57639">https://zh.cppreference.com/mwiki/index.php?title=c/language/basic_concepts&amp;oldid=57639</a>”                    </div>
                    <!-- /printfooter -->
                                                            <!-- catlinks -->
                    <!-- /catlinks -->
                                                            <div class="visualClear"></div>
                    <!-- debughtml -->
                                        <!-- /debughtml -->
                </div>
                <!-- /bodyContent -->
            </div>
        </div>
        <!-- /content -->
        <!-- footer -->
        <div id="cpp-footer-base" class="noprint">
            <div id="footer">
                        <div id="cpp-navigation">
            <h5>导航</h5>
            <ul><li><a href="https://zh.cppreference.com/w/c/language/basic_concepts">Online version</a></li><li>Offline version retrieved 2020-03-14 18:00.</li></ul></div>
                        <ul id="footer-info">
                                    <li id="footer-info-lastmod"> 本页面最后修改于2018年7月17日 (星期二) 19:16。</li>
                                    <li id="footer-info-viewcount">此页面已被浏览过14,771次。</li>
                            </ul>
                    </div>
        </div>
        <!-- /footer -->
        <script>if(window.mw){
mw.loader.state({"site":"loading","user":"missing","user.groups":"ready"});
}</script>
<script src="../../../common/skin_scripts.js"></script>
<script>if(window.mw){
mw.loader.load(["mediawiki.action.view.postEdit","mediawiki.user","mediawiki.page.ready","mediawiki.searchSuggest","mediawiki.hidpi","ext.gadget.MathJax","ext.gadget.ColiruCompiler"], null, true);
}</script>
<script src="../../../common/site_scripts.js"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-2828341-1']);
_gaq.push(['_setDomainName', 'cppreference.com']);
_gaq.push(['_trackPageview']);
</script><!-- Served in 0.223 secs. -->
	</body>
<!-- Cached 20200216161856 -->
</html>